package com.spit.hkpost.util;

import android.content.Context;
import android.media.MediaPlayer;

import com.spit.hkpost.R;


public class VoiceUtils {
    private static MediaPlayer mPlayer;

    public static void init(Context context) {
        mPlayer = MediaPlayer.create(context, R.raw.ding);
        mPlayer.setVolume(1.0f, 1.0f);
    }

    public static void start() {
        if (mPlayer != null && !mPlayer.isPlaying()) {
            mPlayer.start();
        }
    }

    public static void pause() {
        if (mPlayer != null) {
            mPlayer.pause();
        }
    }

    public static void clear(){
        if (mPlayer != null){
            mPlayer = null;
        }
    }
     public static void stop(){
        if (mPlayer != null){
            mPlayer.stop();
        }
    }

}
